<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="../../../yl/index.css" />
    <link rel="stylesheet" href="../../../style/index.css" />
    <title>组织机构信息</title>
    <style>
        .left {
            padding: 1%;
            flex: 0 0 auto;
            width: 100%;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            overflow: auto;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div class="title">
            <div>
                党组织名称&nbsp;&nbsp;<el-input v-model="page.value1" style="width: 200px;margin-right: 10px;"
                    placeholder="请输入内容"></el-input>
                <el-button icon="Search" style="margin: 0; margin-right: 10px;" @click="check">查询</el-button>
                <el-button icon="Refresh" style="margin: 0; margin-right: 10px;" @click="reset">重置</el-button>
                <el-button type="primary" icon="CirclePlus" style="margin: 0; margin-right: 10px;" @click="personalAdd"
                    plain round>添加</el-button>
                <!-- <el-button type="warning" icon="Download" style="margin: 0; margin-right: 10px;" @click="personalAdd"
                    plain round>批量导入</el-button>
                <el-button type="success" icon="Upload" style="margin: 0; margin-right: 10px;" @click="personalAdd"
                    plain round>批量导出</el-button>
                <el-button type="danger" icon="Delete" style="margin: 0; margin-right: 10px;" @click="personalAdd" plain
                    round>批量删除</el-button> -->
            </div>
        </div>
        <div class="body">
            <div class="left">
                <div  id="table" :data-options="JSON.stringify({ 'TableName': 'party_organization','primary_key':'Party_Organization_SerialNumber'})"></div>
                <el-tree ref="tree" id="tree" highlight-current default-expand-all
                    :props="{ label: 'Party_Organization_Name' }" :expand-on-click-node="false"
                    :data-options="JSON.stringify({ 'TableName': 'party_organization', 'NodeCode': '','primary_key':'Party_Organization_SerialNumber' })"
                    :data="treeData">
                    <template #default="{ node, data }">
                        <div class="custom-tree-node">
                            <el-icon v-if="node.level == 1&&node.expanded">
                                <Folder-Opened />
                            </el-icon>
                            <el-icon v-else>
                                <Folder />
                            </el-icon>
                            <span>{{ node.label }}</span>
                            <div class="item"
                                :style="{backgroundColor:Party_Organization_SerialNumber==data.Party_Organization_SerialNumber?'rgb(235.9, 245.3, 255)':''}">
                                <el-button size="small" style="margin-right: 10px;" @click="handleEdit(data,node)" type="primary">修改</el-button>
                                <el-dropdown trigger="click">
                                    <el-button size="small" type="danger">
                                        更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
                                    </el-button>
                                    <template #dropdown>
                                        <el-dropdown-menu>
                                            <el-dropdown-item @click="handleAdd(data)">
                                                添加子党组织
                                            </el-dropdown-item>
                                            <el-dropdown-item @click="handleIntroduce(data)">
                                                更新简介
                                            </el-dropdown-item>
                                            <el-dropdown-item @click="handleIntroduce1(data)">
                                                查看简介
                                            </el-dropdown-item>
                                            <el-dropdown-item @click="handleSkip(row)">
                                                添加责任人
                                            </el-dropdown-item>
                                            <!-- <el-dropdown-item @click="handleEdit(data,node)">
                                                修改
                                            </el-dropdown-item> -->
                                            <el-dropdown-item @click="handleDelete1(data)">
                                                删除
                                            </el-dropdown-item>
                                        </el-dropdown-menu>
                                    </template>
                                </el-dropdown>
                            </div>
                        </div>
                    </template>
                </el-tree>
            </div>
            <!-- <div class="right">
                <el-table id="table" :data-options="JSON.stringify({ 'TableName': 'party_organization','primary_key':'Party_Organization_SerialNumber'})"  height="450" v-loading="loading" ref="multipleTable" tooltip-effect="dark" :data="Tabletdata"
                    @selection-change="handleSelectionChange" >
                    <el-table-column min-width="180" v-for="column in columns" :key="column.COLUMN_NAME"
                        :prop="column.COLUMN_NAME" :label="column.COLUMN_COMMENT">
                        <template #scope="scope">
                            <div :draggable="true" @dragstart="dragStart(scope.$index)" class="draggable-row">
                                {{ scope.row[column.prop] }}
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column label="操作" fixed="right" width="180">
                        <template #default="{row}">
                            <div style="display: flex; align-items: center;" >
                                <el-button style="margin-right: 10px;" size="small" @click="handleIntroduce(row)" >
                                    更新简介
                                </el-button> 
                                <el-dropdown trigger="click">
                                    <el-button size="small" type="danger">
                                        更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
                                    </el-button>
                                    <template #dropdown>
                                        <el-dropdown-menu>
                                            <el-dropdown-item @click="handleEdit(row,{level:3})">
                                                编辑
                                            </el-dropdown-item>
                                            <el-dropdown-item @click="handleSkip(row)">
                                                添加责任人
                                            </el-dropdown-item>
                                            <el-dropdown-item @click="handleDelete(row)">
                                                删除
                                            </el-dropdown-item>
                                        </el-dropdown-menu>
                                    </template>
                                </el-dropdown>
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination style="margin-top: 1%;" :current-page="page.PageNumber" :page-size="page.RowAmount"
                    :page-sizes="[10, 100, 200, 300, 400]" layout="total, sizes, prev, pager, next, jumper"
                    :total="Total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
            </div> -->
        </div>
        <el-dialog v-model="showDialog" width="550" class="custom-dialog">
            <template #header>
                <div class="dialog-header">
                    <span>设置显示字段</span>
                </div>
            </template>
            <div class="dialog-content">
                <el-checkbox v-model="isAllChecked" @change="handleAllChecked"
                    class="full-width-checkbox">全选</el-checkbox>
                <div class="checkbox-columns">
                    <el-checkbox-group v-model="checkedFields" style="width: 100%; display: flex; flex-wrap: wrap">
                        <el-checkbox :disabled="field.COLUMN_KEY === 'PRI'" v-for="field in fields" :key="field"
                            :value="field" style="width: 50%; height: 30px; margin-right: 0px">
                            {{ field.COLUMN_COMMENT }}
                        </el-checkbox>
                    </el-checkbox-group>
                </div>
            </div>
            <template #footer>
                <div class="dialog-footer">
                    <el-button @click="showDialog = false" class="cancel-btn">取消</el-button>
                    <el-button type="primary" @click="saveFields" class="confirm-btn">保存</el-button>
                </div>
            </template>
        </el-dialog>
    </div>
    </div>
    <script src="../../../utils/utils.js"></script>
    <script src="../../../config/config.js"></script>
    <script src="../../../utils/mixins.js"></script>
    <script src="../../../yl/vue.js"></script>
    <script src="../../../yl/index.js"></script>
    <script src="../../../yl/zh-cn.mjs"></script>
    <script src="../../../yl/index.iife.min.js"></script>
    <script src="../../../yl/jquery.min.js"></script>
    <script src="../../../utils/jquery.cookie.js"></script>
    <script src="../../../api/request.js"></script>
    <script src="js/index.js"></script>
</body>

</html>